home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue44 / construc / CGI.DPR < prev    next >
Encoding:
Text File  |  1999-02-25  |  768 b   |  37 lines

  1. program CGI;
  2. {$APPTYPE CONSOLE}
  3. uses
  4.   DrBobCGI, SysUtils, Classes, IniMod;
  5. var
  6.   Notes: TStringList = nil;
  7.   User, Password: String;
  8.   Get: Boolean;
  9.   i: Integer;
  10. begin
  11.   writeln('Content-type: text/plain');
  12.   writeln;
  13.   User := Value('User');
  14.   Password := Value('Password');
  15.   Notes := TStringList.Create;
  16.   Get := Value('Notes') = '';
  17.   if not Get then Notes.Text := Value('Notes');
  18.   try
  19.     try
  20.       if Get then
  21.       begin
  22.         GetLines(User,Password,Notes);
  23.         for i:=1 to Notes.Count do writeln(Notes[Pred(i)])
  24.       end
  25.       else
  26.       begin
  27.         SetLines(User,Password,Notes);
  28.         writeln('OK')
  29.       end
  30.     except
  31.       on E: Exception do writeln(E.Message)
  32.     end
  33.   finally
  34.     Notes.Free
  35.   end
  36. end.
  37.